<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
<script type="text/javascript" src="${requestScope.contextPath}/js/cubiq-iscroll/iscroll.js"></script>
<script type="text/javascript">
	var myScroll;
	function loaded() {
		myScroll = new iScroll('wrapper', { 
			checkDOMChanges: true,
			zoom: false
		});
		<c:if test="${param.endY != null and param.endY != ''}">
		myScroll.scrollTo(0, ${param.endY}, 0);
		endY = ${param.endY};
	</c:if>
	}
	document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
	window.addEventListener('DOMContentLoaded', setTimeout(function () { loaded(); }, 100), false);
	
	
	function newMore() {
		var currCnt = ${mapList2.CurrPage}*${mapList2.OnePageCnt};
		var tot = ${mapList2.TotalRecordCnt};
		
		if (currCnt > tot) {
			$('.more11').html('없음');
			return;
		}		

		var nParm = "?strMode=10&BoardCD=${BoardCD}&SortFieldName=SortCreateDate&SortAscDesc=desc&CompanyCode=${CompanyCode}&BoardRootCD=${BoardRootCD}&BoardName=${BoardName}&BoardRootCDName=${BoardRootCDName}&B_IsSub=${B_IsSub}&page=${page+1}&endY="+endY;
		location.href='${requestScope.contextPath}/business/mBoard/boardList.do'+nParm;
	}
	
	$(function() {
		var dates = $('#SearchStartDate, #SearchEndDate').datepicker({
			showOn: "button",
			buttonImage: "${requestScope.contextPath}/images/reservation/cal1.gif",
			buttonImageOnly: true,
			numberOfMonths: 1,
			dateFormat: 'yy-mm-dd',
			showMonthAfterYear:true,
			monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
			onSelect: function(selectedDate) {
				var option = this.id == "SearchStartDate" ? "minDate" : "maxDate";
				var instance = $(this).data("datepicker");
				var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
				dates.not(this).datepicker("option", option, date);
			}
		});
	});
</script>
<style type="text/css" media="all">
/*원본 : #wrapper { position:absolute; z-index:1; top:48px; bottom:0px; left:0; width:320px; overflow:auto; }*/
#wrapper { position:absolute; z-index:1; top:48px; bottom:0px; left:0; width:100%; overflow:auto; }
#scroller { position:absolute; -webkit-tap-highlight-color:rgba(0,0,0,0); width:100%; padding:0; background:#fff; }
</style>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>전사소식</h1>
			<c:if test="${B_IsSub == '0'}">
				<p class="list"><a href="javascript:goUrl('${requestScope.contextPath}/business/mBoard/boardSearchList.do?strMode=3&BoardCD=${BoardCD}&CompanyCode=${CompanyCode}&BoardRootCD=${BoardRootCD}&BoardName=${BoardNameUtf}&BoardRootCDName=${BoardRootCDNameUtf}&B_IsSub=${B_IsSub}');"><img src="${requestScope.contextPath}/images/btn/btn_search3.gif" alt="검색" /></a></p>
			</c:if>
			<c:choose>
       			<c:when test="${Depth == null}">
				</c:when>
				<c:otherwise>
				</c:otherwise>
			</c:choose>
		</div><!-- // header -->
		<div id="wrapper" class="content">
		<div id="scroller">
			<h3><a href="javascript:goUrl('${requestScope.contextPath}/business/mBoard/mBoardList.do?tog=${BoardRootCD}');">${BoardRootCDName}</a> &gt; ${BoardName}</h3>
			<c:choose>
       			<c:when test="${B_IsSub eq '0'}">
					<div class="news">
						<ul>
					<c:choose>
					<c:when test="${empty mapList}">
						<li>일치하는 자료가 없습니다.</li>
					</c:when>
					<c:otherwise>
							<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
							<li><a href="javascript:goUrl('${requestScope.contextPath}/business/mBoard/boardView.do?strMode=4&ArticleCD=${mapInfo.ArticleCD }&CompanyCode=${CompanyCode }&strBoardRootCD=${BoardRootCD }&BoardCD=${mapInfo.BoardCD}&BoardName=${BoardName}&BoardRootCDName=${BoardRootCDName}&B_IsSub=${B_IsSub}&page=${page}&endY='+endY);"><span class="bold">${mapInfo.Title}</span><span class="date1">${mapInfo.UCreateDate}</span></a></li>
							</c:forEach>
					</c:otherwise>
					</c:choose>
						</ul>
						<c:if test="${mapList2.TotalRecordCnt > fn:length(mapList)}"> 
							<div class="btn_more11">
								<p class="more11"><a href="javascript:newMore();">15개 더보기</a></p>
								<p class="more22"><a href="javascript:myScroll.scrollTo(0, 0, 0);"><img src="${requestScope.contextPath}/images/news/btn_top.gif" alt="맨위로" />&nbsp;&nbsp;맨위로</a></p>
							</div>
						</c:if>
					</div>
				</c:when>
				<c:otherwise>
					<div class="news board2">
						<ul>
							<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
								<a href="${requestScope.contextPath}/business/mBoard/boardList.do?strMode=10&BoardCD=${mapInfo.BoardCD}&SortFieldName=SortCreateDate&SortAscDesc=desc&CompanyCode=${CompanyCode }&BoardRootCD=${mapInfo.BoardRootCD}&BoardName=${mapInfo.BoardNameUtf}&BoardRootCDName=${BoardRootCDNameUtf }&B_IsSub=${mapInfo.B_IsSub}&Depth=${mapInfo.Depth}"><li>
									${mapInfo.BoardName}
									<c:if test="${mapInfo.B_IsSub != '0'}"> 
									<span class="arrow"><img src="${requestScope.contextPath}/images/board/arrow3.gif" alt="" /></span>
									</c:if>
								</li>
								</a>
							</c:forEach>
						</ul>
					</div>
				</c:otherwise>
			</c:choose>
			</div>
		</div><!-- // content -->
	</div><!-- // wrap -->
</body>
</html>